package com.taoge.biz.common.constant;

import com.taoge.biz.common.enums.SmsActionType;

import java.util.HashMap;

/**
 * @ClassName: com.taoge.biz.common.constant
 * @Description: 短信业务常量
 * @Author: YaoSiCheng
 * @Date: 2024-06-17 16:33
 **/
public class SmsConstant {
    // {业务类型：模版ID}
   public static final HashMap<SmsActionType,String> templateCodeMap = new HashMap<>();
   // {渠道：{业务类型：模版ID}}
   static{
       templateCodeMap.put(SmsActionType.REGISTER,"790370");
       templateCodeMap.put(SmsActionType.LOGIN,"790371");
       templateCodeMap.put(SmsActionType.FORGET_PASSWORD,"792583");
       templateCodeMap.put(SmsActionType.AUTH,"790370");
   }

   /**
    * @title: getTemplateCodeCode
    * @description: 根据短信业务类型获取短信模版id
    * @date:   2024-06-17 16:41:08
    * @author: YaoSiCheng
    * @param:  actionType
    * @return: String
    */
   public static String getTemplateCodeCode(SmsActionType actionType){
       return templateCodeMap.get(actionType);
   }

    /**
     * @title: generateTemplateParam
     * @Description: 获取短信模版
     * @date:   2024-06-05 15:26:44
     * @author: YaoSiCheng
     * @param:  code 验证码
     * @return: String
     */
    public static String[] generateTemplateParam(String code) {
        return new String[]{code,"3"};
    }
   
   /**
    * @title: isEnvDev
    * @description: 判断是否是测试环境
    * @date:   2024-06-17 16:47:10
    * @author: YaoSiCheng
    * @param:  
    * @return: boolean
    */
   public static boolean isEnvDev(){
       return  true;
   }
}
